import request from '@/utils/request'

// 查询公告列表
export function listNotice(query) {
  return request({
    url: '/system/notice/list',
    method: 'get',
    params: query
  })
}

// 查询公告详细
export function getNotice(noticeId) {
  return request({
    url: '/system/notice/' + noticeId,
    method: 'get'
  })
}

// 新增公告
export function addNotice(data) {
  return request({
    url: '/system/notice',
    method: 'post',
    data: data
  })
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: '/system/notice',
    method: 'put',
    data: data
  })
}

// 删除公告
export function delNotice(noticeId) {
  return request({
    url: '/system/notice/' + noticeId,
    method: 'delete'
  })
}


// 给学生发送审核通过通知
export function studentLeavePassAdd(data) {
  return request({
    url: '/system/notice/studentLeavePassAdd',
    method: 'post',
    data: data
  })
}


// 给学生发送审核不通过通知
export function studentLeaveNotpassAdd(data) {
  return request({
    url: '/system/notice/studentLeaveNotpassAdd',
    method: 'post',
    data: data
  })
}

// 提醒学生假期结束通知
export function studentEndLeave(data) {
  return request({
    url: '/system/notice/studentEndLeave',
    method: 'post',
    data: data
  })
}

// 给教师发送审核通知
export function teacherAuditNoticeAdd(data) {
  return request({
    url: '/system/notice/teacherAuditAdd',
    method: 'post',
    data: data
  })
}

// 提醒教师学生已返校
export function studentEeturnSchool(data) {
  return request({
    url: '/system/notice/studentEeturnSchool',
    method: 'post',
    data: data
  })
}

// 查询通知列表
export function listNoticeAll(query) {
  return request({
    url: '/system/notice/all-list-admin',
    method: 'get',
    params: query
  })
}

// 确认已读
export function sureSotificationById(noticeId) {
  return request({
    url: '/system/notice/' + noticeId,
    method: 'put'
  })
}